<%#
 Copyright 2013-2025 the original author or authors from the JHipster project.

 This file is part of the JHipster project, see https://www.jhipster.tech/
 for more information.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      https://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-%>
# API-first development with OpenAPI
# This file will be used at compile time to generate Spring-MVC endpoint stubs using openapi-generator
openapi: "3.0.1"
info:
  title: "<%= baseName %>"
  version: 0.0.1
servers:
  - url: http://localhost:<%= serverPort %>/api
    description: Development server
  - url: https://localhost:<%= serverPort %>/api
    description: Development server with TLS Profile
paths: {}
components:
  responses:
    Problem:
      description: error occurred - see status code and problem object for more information.
      content:
        application/problem+json:
          schema:
            type: object
            properties:
              type:
                type: string
                format: uri
                description: |
                  An absolute URI that identifies the problem type. When dereferenced,
                  it SHOULD provide human-readable documentation for the problem type
                  (e.g., using HTML).
                default: 'about:blank'
                example: 'https://www.jhipster.tech/problem/problem-with-message'
              title:
                type: string
                description: |
                  A short, summary of the problem type. Written in english and readable
                  for engineers (usually not suited for non technical stakeholders and
                  not localized); example: Service Unavailable
              status:
                type: integer
                format: int32
                description: |
                  The HTTP status code generated by the origin server for this occurrence
                  of the problem.
                minimum: 100
                maximum: 600
                exclusiveMaximum: true
                example: 503
              detail:
                type: string
                description: |
                  A human readable explanation specific to this occurrence of the
                  problem.
                example: Connection to database timed out
              instance:
                type: string
                format: uri
                description: |
                  An absolute URI that identifies the specific occurrence of the problem.
                  It may or may not yield further information if dereferenced.
<% if (authenticationTypeJwt) { %>
  securitySchemes:
    jwt:
      type: http
      description: JWT Authentication
      scheme: bearer
      bearerFormat: JWT
  <%_ if (applicationTypeMonolith) { _%>
    basic:
      type: http
      description: Basic Authentication
      scheme: basic
  <%_ } _%>
security:
  - jwt: []
  <%_ if (applicationTypeMonolith) { _%>
  - basic: []
  <%_ } _%>
<% } %>
<% if (authenticationTypeOauth2) { %>
  securitySchemes:
    oauth:
      type: oauth2
      description: OAuth2 authentication with KeyCloak
      flows:
        authorizationCode:
          authorizationUrl: http://localhost:9080/realms/jhipster/protocol/openid-connect/auth
          tokenUrl: http://localhost:9080/realms/jhipster/protocol/openid-connect/token
          scopes:
            jhipster: Jhipster specific claims
            email: Email claims
            profile: Profile claims
    openId:
      type: openIdConnect
      description: OpenID Connect authentication with KeyCloak
      openIdConnectUrl: http://localhost:9080/realms/jhipster/.well-known/openid-configuration
security:
  - oauth: [jhipster, email, profile]
  - openId: [jhipster, email, profile]
<% } %>
<% if (authenticationTypeSession) { %>
  securitySchemes:
    sessionId:
      type: apiKey
      name: JSESSIONID
      in: cookie
    csrf:
      type: apiKey
      name: XSRF-TOKEN
      in: cookie
security:
  - sessionId: []
  - csrf: []
<% } %>
